/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ControleAcademico.Model.Dao;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author arthur
 * @author renan
 * @author tais
 * @author vinicius
 */
public class EntityManagerUtil {
    private static EntityManagerFactory emf = null;
    
    public static EntityManager getEntityManager() {
        if (emf == null){
            emf = Persistence.createEntityManagerFactory("tp2");
        }
        return emf.createEntityManager();
    }
}